package com.jcl.core.constants;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

/**
 * @ClassName ChannelSource
 * @Author yyliu
 * @Date 2018/9/25 16:35
 * @Version 1.0
 **/
public class ChannelSourceConstant {

    public static final String ZHAOPIN = "zhaopin";
    public static final String _51JOB = "51job";
    public static final String LAGOU = "lagou";
    public static final String DAJIE = "dajie";
    public static final String HUNTER = "hunter";
    public static final String BOSS = "boss";

    public static final String CRAWLER_ZHAOPIN = "zhaopin";
    public static final String CRAWLER_51JOB = "51job";
    public static final String CRAWLER_LAGOU = "lagou";
    public static final String CRAWLER_DAJIE = "dajie";
    public static final String CRAWLER_HUNTER = "hunter";
    public static final String CRAWLER_BOSS = "boss";

    public static final Map<String, String> sourceMap = new LinkedHashMap<>();
    public static final Map<String, String> crawlerSourceMap = new LinkedHashMap<>();

    public static final Set<String> sources;

    static {
        sourceMap.put(ZHAOPIN, "智联招聘");
        sourceMap.put(_51JOB, "前程无忧");
        sourceMap.put(LAGOU, "拉钩");
        sourceMap.put(DAJIE, "大街");
        sourceMap.put(HUNTER, "猎聘");
        sourceMap.put(BOSS, "BOSS直聘");

        sources = sourceMap.keySet();

        crawlerSourceMap.put(ZHAOPIN, CRAWLER_ZHAOPIN);
        crawlerSourceMap.put(_51JOB, CRAWLER_51JOB);
        crawlerSourceMap.put(LAGOU, CRAWLER_LAGOU);
        crawlerSourceMap.put(DAJIE, CRAWLER_DAJIE);
        crawlerSourceMap.put(HUNTER, CRAWLER_HUNTER);
        crawlerSourceMap.put(BOSS, CRAWLER_BOSS);
    }

    /* *
     * @Author yyliu
     * @Description //TODO
     * @Date 16:41 2018/9/25
     * @Param [source]
     * @return boolean
     **/
    public static boolean hasSource(String source) {
        return sources.contains(source) ? true : false;
    }

}
